﻿<%@ Page Language="C#" AutoEventWireup="true" Codebehind="Default.aspx.cs" Inherits="ExampleWeb._Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Untitled Page</title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <asp:GridView ID="grid" runat="server" AllowPaging="True" Height="50%" PageSize="20"
                Width="100%" AutoGenerateColumns="false" OnPageIndexChanging="grid_PageIndexChanging">
                <Columns>
                    <asp:BoundField HeaderText="Title" DataField="Title" />
                    <asp:TemplateField HeaderText="First Name">
                        <ItemTemplate>
                            <asp:Label ID="Firstname" runat="server" Text='<%# Convert.ToString(Eval("Contactid.Firstname")) %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Last Name">
                        <ItemTemplate>
                            <asp:Label ID="Lastname" runat="server" Text='<%# Convert.ToString(Eval("Contactid.Lastname")) %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Manager (First Name)">
                        <ItemTemplate>
                            <asp:Label ID="Firstname" runat="server" Text='<%# Convert.ToString(Eval("Managerid.Contactid.Lastname")) %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Manager (Last Name)">
                        <ItemTemplate>
                            <asp:Label ID="Lastname" runat="server" Text='<%# Convert.ToString(Eval("Managerid.Contactid.Lastname")) %>' />
                        </ItemTemplate>
                    </asp:TemplateField>
                </Columns>
            </asp:GridView>
        </div>
    </form>
</body>
</html>
